#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "mini.kit.h"

int main(int argc, char* argv[])
{
	time_t    t;
	struct tm tms;
	if( argc < 2 ) {
		fprintf(stderr, "usage: %s unix-timestamp format\n", argv[0]);
		return 1;
	}
	t = strtoull(argv[1], NULL, 10);
	const char* fmt = "%F %T";
	if( argc > 2 ) {
		fmt = argv[2];
	}

	fprintf(stdout, "%s\n", MINIKIT::DateTime::format( t, fmt ).c_str() );
/*
	const char* dt  = argv[1];

	
	localtime_r(&t, &tms);
	char buff[256] = {0};
	strftime(buff, sizeof(buff), fmt, &tms);
	fprintf(stdout, "%s\n",  buff);
*/
	return 0;
}

